function Up($){
	$('html, body').animate({scrollTop:0},500);
}

$(document).ready(function(){
	$('#blocks ul').after('<div id="block-content"></div>');
	$('#blocks li').each(function(){
		if($(this).attr('class')=='active'){
			$('#block-content').html($('a',this).next().html());
		}
	});
	$('#blocks ul a').click(function(e){
		e.preventDefault();
		$(this).parent().addClass('active').siblings().removeClass('active');
		$('#block-content').html($(this).next().html());
		//alert($(this).next().html());
	});
	
	$window = $(window);
	$sticky = $("#sticky-bar");
	$Hsticky = $sticky.outerHeight();
	$btnUp = $("#btnUp");
	$menu=$('#navbar');
	$('.w960',$sticky).html($menu.html());
	/*$home = $('#header').outerHeight() + $('#home-content').outerHeight()-$sticky.outerHeight();
	$our_profiles=$home+$('#what-is-seo').outerHeight();
	$seo_services=$our_profiles+$('#our-profiles').outerHeight();
	$seo_consulting=$seo_services+$('#seo-services').outerHeight();
	$contact=$seo_consulting+$('#seo-consulting').outerHeight();*/
	
	$window.scroll(function(){
		$pos=$window.scrollTop();
		if($pos >= $menu.offset().top){
			$sticky.fadeIn("fast");
			$btnUp.fadeIn("fast");
		}else{
			$sticky.fadeOut("fast");
			$btnUp.fadeOut("fast");
		}
	});
	
	$btnUp.click(function(){
		$("html, body").animate({scrollTop:0},500);
	});
	
});